Optimal. Leaf size=37 \[ \frac{1}{2} \cos (2 a) \text{CosIntegral}\left (\frac{2 b}{x}\right )-\frac{1}{2} \sin (2 a) \text{Si}\left (\frac{2 b}{x}\right )+\frac{\log (x)}{2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.049541, antiderivative size = 37, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.286, Rules used = {3425, 3378, 3376, 3375} \[ \frac{1}{2} \cos (2 a) \text{CosIntegral}\left (\frac{2 b}{x}\right )-\frac{1}{2} \sin (2 a) \text{Si}\left (\frac{2 b}{x}\right )+\frac{\log (x)}{2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3425
Rule 3378
Rule 3376
Rule 3375
Rubi steps
\begin{align*} \int \frac{\sin ^2\left (a+\frac{b}{x}\right )}{x} \, dx &=\int \left (\frac{1}{2 x}-\frac{\cos \left (2 a+\frac{2 b}{x}\right )}{2 x}\right ) \, dx\\ &=\frac{\log (x)}{2}-\frac{1}{2} \int \frac{\cos \left (2 a+\frac{2 b}{x}\right )}{x} \, dx\\ &=\frac{\log (x)}{2}-\frac{1}{2} \cos (2 a) \int \frac{\cos \left (\frac{2 b}{x}\right )}{x} \, dx+\frac{1}{2} \sin (2 a) \int \frac{\sin \left (\frac{2 b}{x}\right )}{x} \, dx\\ &=\frac{1}{2} \cos (2 a) \text{Ci}\left (\frac{2 b}{x}\right )+\frac{\log (x)}{2}-\frac{1}{2} \sin (2 a) \text{Si}\left (\frac{2 b}{x}\right )\\ \end{align*}
Mathematica [A] time = 0.0586643, size = 32, normalized size = 0.86 \[ \frac{1}{2} \left (\cos (2 a) \text{CosIntegral}\left (\frac{2 b}{x}\right )-\sin (2 a) \text{Si}\left (\frac{2 b}{x}\right )+\log (x)\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.011, size = 36, normalized size = 1. \begin{align*} -{\frac{1}{2}\ln \left ({\frac{b}{x}} \right ) }-{\frac{\sin \left ( 2\,a \right ) }{2}{\it Si} \left ( 2\,{\frac{b}{x}} \right ) }+{\frac{\cos \left ( 2\,a \right ) }{2}{\it Ci} \left ( 2\,{\frac{b}{x}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [C] time = 1.12719, size = 69, normalized size = 1.86 \begin{align*} \frac{1}{4} \,{\left ({\rm Ei}\left (\frac{2 i \, b}{x}\right ) +{\rm Ei}\left (-\frac{2 i \, b}{x}\right )\right )} \cos \left (2 \, a\right ) + \frac{1}{4} \,{\left (i \,{\rm Ei}\left (\frac{2 i \, b}{x}\right ) - i \,{\rm Ei}\left (-\frac{2 i \, b}{x}\right )\right )} \sin \left (2 \, a\right ) + \frac{1}{2} \, \log \left (x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.43462, size = 144, normalized size = 3.89 \begin{align*} \frac{1}{4} \,{\left (\operatorname{Ci}\left (\frac{2 \, b}{x}\right ) + \operatorname{Ci}\left (-\frac{2 \, b}{x}\right )\right )} \cos \left (2 \, a\right ) - \frac{1}{2} \, \sin \left (2 \, a\right ) \operatorname{Si}\left (\frac{2 \, b}{x}\right ) + \frac{1}{2} \, \log \left (x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 4.6788, size = 31, normalized size = 0.84 \begin{align*} \frac{\log{\left (x \right )}}{2} - \frac{\sin{\left (2 a \right )} \operatorname{Si}{\left (\frac{2 b}{x} \right )}}{2} + \frac{\cos{\left (2 a \right )} \operatorname{Ci}{\left (\frac{2 b}{x} \right )}}{2} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\sin \left (a + \frac{b}{x}\right )^{2}}{x}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]